// TestCaseGeneratorUI
// (c)2007 Mark Bulmahn. mBulmahn@web.de
// License: GPL 2.0
// Project: TestCaseGenerator. http://www.codeplex.com/TestCaseGenerator

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace TestCaseGenerator
{
    public partial class FrmExpSqlCe : Form
    {
        string connectionString = "";
        public string ConnectionString
        {
            get { return connectionString; }
        }

        string destTableName = "";
        public string DestTableName
        {
            get { return destTableName; }
        }

        public FrmExpSqlCe()
        {
            InitializeComponent();
        }

        private void FrmExpSqlCe_Load(object sender, EventArgs e)
        {

        }

        private void butOK_Click(object sender, EventArgs e)
        {
            if ((textDestTableName.Text != "") && (System.IO.File.Exists(textFilename.Text)))
            {
                destTableName = textDestTableName.Text;
                connectionString = "Data Source='" + textFilename.Text + "'";
                Close();
            }
            else
                MessageBox.Show("Datenbankdatei existiert nicht\noder Tabellenname fehlt!");
        }

        private void butCancel_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void butGetFile_Click(object sender, EventArgs e)
        {
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                textFilename.Text = openFileDialog1.FileName;
            }
        }
    }
}